package cn.edu.xjtu.hash.hashSet.containsDuplicate;

import java.util.HashSet;
import java.util.Set;

public class Solution {
  public static void main(String[] args) {

  }

  public boolean containsDuplicate(int[] nums) {
    Set<Integer> set = new HashSet<>();
    for (Integer i : nums) {
      if (set.contains(i)) {
        return true;
      }
      set.add(i);
    }
    return false;
  }
}
